home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / util / misc / TOJ_Utils.lha / FOR12.LHA / For.doc < prev    next >
Text File  |  1994-06-08  |  3KB  |  110 lines

  1.  
  2.  
  3.                                    For V. 1.2
  4.  
  5.                           © 1993 Antonello Biancalana
  6.                           ProMIND Software Development
  7.  
  8.  
  9.     Format: For <variable> IN <set> DO <command>
  10.  
  11.     Template: VAR/A,IN/K,SET/A,DO/K,COMMAND/A
  12.  
  13.     Purpose:  Performs a command for a set of files or for a specific number
  14.               of times.
  15.  
  16.     Specification:  This command sequentially sets the specified variable to
  17.     each member of set, and uses the variable to evaluate the command.  If a
  18.     member of set is an expression involving pattern matching (#?), then the
  19.     variable is set to each matching item from the  disk  or  the  specified
  20.     path.  Set can also be an expression of multiple files or suffixes. When
  21.     multiple files or suffixes are used in set,  they must  be  enclosed  in
  22.     parenthesis. Variables' names must always begin with a dollar sign ($).
  23.     When the set starts with a % (percent)  sign,  an  integer  number  must
  24.     follow.  In this way you can repeat the command for a specific number of
  25.     times.
  26.  
  27.     Examples:
  28.  
  29.     For $var in Amiga_is_(fantastic|great|amazing) do echo $var
  30.  
  31.     Amiga_is_fantastic
  32.     Amiga_is_great
  33.     Amiga_is_amazing
  34.  
  35.  
  36.  
  37.     For $x in d#?.c do list $x
  38.  
  39.     dinfo.c                     7663 ----rwed 02-Jul-93 12:06:52
  40.     1 file - 16 blocks used
  41.     DirUsage.c                 13634 ----rwed 12-Nov-92 17:02:59
  42.     1 file - 28 blocks used
  43.  
  44.  
  45.  
  46.     For $v in CSources:d#?.(c|o) do list $v
  47.  
  48.     dinfo.c                     7663 ----rwed 02-Jul-93 12:06:52
  49.     1 file - 16 blocks used
  50.     DirUsage.c                 13634 ----rwed 12-Nov-92 17:02:59
  51.     1 file - 28 blocks used
  52.     dinfo.o                     3552 ----rwed 02-Jul-93 12:08:20
  53.     1 file - 7 blocks used
  54.     DirUsage.o                  8674 ----rwed 12-Nov-92 17:05:40
  55.     1 file - 17 blocks used
  56.  
  57.  
  58.  
  59.     For $q in (DirUsage|dinfo|WSet).c do copy $q ram:
  60.  
  61.     Files DirUsage.c, dinfo.c and WSet.c will be copied in the ram:
  62.  
  63.  
  64.  
  65.     For $drive in df(0|1|2): do AddBuffers $drive 32
  66.  
  67.     df0: has 32 buffers
  68.     df1: has 32 buffers
  69.     df2: has 32 buffers
  70.  
  71.  
  72.  
  73.     The variable $drive will be equal to df0:, df1: and df2: then it will be
  74.     used as an argument to the command AddBuffers.
  75.     This is the same as if you type the following three commands:
  76.  
  77.         AddBuffers df0: 32
  78.         AddBuffers df1: 32
  79.         AddBuffers df2: 32
  80.  
  81.  
  82.     For $n in %5 do echo $n
  83.     1
  84.     2
  85.     3
  86.     4
  87.     5
  88.  
  89.  
  90.     The  command  echo  is  executed  five times (%5) and for each issue the
  91.     variable $n is set to the current iteration number from 1 to 5.
  92.  
  93.  
  94.  
  95.     ----
  96.  
  97.     For has been written by:
  98.  
  99.         Antonello Biancalana
  100.         ProMIND Software Development
  101.         Perugia, ITALY
  102.  
  103.     FIDO: 2:335/412.3
  104.     HAMCALL: IK0TOJ
  105.  
  106.     NOTE:  This  is a shareware program and it can be freely distributed to
  107.     anyone. The program MUST be distributed with this documentation file.
  108.  
  109.  
  110.